package com.example.myhttp

import android.app.Application
import android.content.Context
import kotlin.properties.Delegates

/**
 *
 * @describe:
 * @Time:      2023/2/15
 * @author:    阳
 */
class KeyApplication : Application() {

    companion object {
        var context: Context by Delegates.notNull()
            private set
        @JvmStatic
        fun getInstance(): KeyApplication = context as KeyApplication
    }

    override fun onCreate() {
        super.onCreate()
        context = applicationContext

        // 注册全局异常处理类
        CrashExceptionHandler.newInstance().init(applicationContext)


    }
}